home *** CD-ROM | disk | FTP | other *** search
- class classes.fx.LifeMeter
- {
- var clip;
- var lifeOrig;
- var num;
- var c;
- var lifeTarget;
- var adjusting = false;
- var alpha = 0;
- var Name = "lifeMeter";
- function LifeMeter()
- {
- this.clip = _root.attachMovie("lifeMeter","lifeMeterClip",817880);
- this.clip._x = _root[_root.char].x + 6;
- this.clip._y = _root[_root.char].y - 12;
- }
- function adjust(plifeOrig, pnum)
- {
- this.lifeOrig = plifeOrig;
- this.num = pnum;
- this.adjusting = true;
- this.clip._x = _root[_root.char].x + 6;
- this.clip._y = _root[_root.char].y - 12;
- this.clip._alpha = 120;
- this.c = 0;
- this.alpha = 100;
- this.lifeTarget = (this.lifeOrig + this.num) / 100 * 24;
- }
- function main()
- {
- this.clip._alpha = this.alpha;
- this.alpha -= 2;
- if(this.alpha < 0)
- {
- this.alpha = 0;
- }
- else
- {
- this.clip._x = _root[_root.char].x + 6;
- this.clip._y = _root[_root.char].y - 12;
- }
- if(this.adjusting)
- {
- this.c = this.c + 1;
- this.clip._x = _root[_root.char].x + 6;
- this.clip._y = _root[_root.char].y - 12;
- this.alpha = 100;
- if(this.num < 0)
- {
- this.clip.bar._width -= 1;
- if(this.clip.bar._width <= this.lifeTarget)
- {
- this.clip.bar._width = this.lifeTarget;
- }
- }
- else
- {
- this.clip.bar._width += 1;
- if(this.clip.bar._width >= this.lifeTarget)
- {
- this.clip.bar._width = this.lifeTarget;
- }
- }
- if(this.c == 45)
- {
- _root[_root.char].inv = false;
- }
- if(this.c == 60)
- {
- this.adjusting = false;
- }
- }
- }
- }
-